package jdk8.functions;

import java.util.function.Function;

public class DemoFunction {
    public static void main(String[] args) {
        Integer num = getValue(s -> Integer.parseInt(s));
        System.out.println(num);

        method(s -> Integer.parseInt(s), s -> s *= 10);
    }

    private static Integer getValue(Function<String, Integer> function){
        return function.apply("10");
    }

    private static void method(Function<String,Integer> one, Function<Integer,Integer> two){
        int num = one.andThen(two).apply("10");
        System.out.println(num);
    }
}
